use std::fmt::Display;
use std::fmt::Debug;

fn bubble_sort<T: PartialOrd + Display+Debug>(list: &mut [T]){
    for number1 in 1..list.len(){
        for number2 in 0..list.len()-number1{
            if list[number2]>list[number2+1]{
                list.swap(number2,number2+1);
            }
        }
    }
    println!("The vector after sort is {:?}",list);
}

fn main() {
    let mut v = vec![7,4,1,12];
    bubble_sort(&mut v);

    let mut v=vec!['a','d','g','f','z','f','l'];
    bubble_sort(&mut v);
}